This repository has been archived by the owner on Jul 20, 2018. It is now read-only.
Adding three checks for non-escaped localization function calls. #315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The first checks if output of the __( ), _x( ), _n( ), _nx( ) functions
is being printed directly, via echo( ), print( ) or vprintf( )
-- care is taken to ensure that both echo with and without
brackets is considered, and same with print. These are blockers.
The second checks if __( ), _x( ), _n( ), _nx( ) functions are
being called (without printing). These are warnings.
The third checks if _e( ) or _ex( ) are being called.
These are blockers.
These checks are all against localization functions which do not
HTML-escape. Not escaping can be dangerous since HTML code could
be injected via malicous translation strings. Blocking was considered
prudent with direct printing, because there is no escaping involved,
whereas warnings are issued when strings are possibly escaped later
on in processing.
This will resolve issue #287.